<?php
// Test of R0910CMS 
// created by TLightSky
// time : 20100207

class ConfigTest extends UnitTestCase {
    function testReadConfig() {
        
        R_Data::loadDataFromFile(TEST_ROOT.'TestConfig.php');
        // here we use absolute path
        //$this->assertEqual( (R_Data::get('cfg'))['db']['host'] 
        //    , '127.0.0.1');
        $cfg = &R_Data::get('cfg');
        $this->assertEqual( $cfg['dbHost'],'127.0.0.1');
        $this->assertEqual( $cfg['http_root'], WURL);

        R_Data::set('cfg', 'db2', 'testdb');
        $this->assertEqual( R_Data::get('cfg','db2'),'testdb');

        $cfg_ = R_Data::get('cfg');
        $this->assertEqual( $cfg_['db2'],'testdb');

        //$cfg = (R_Data::get('cfg1'))->g('dbHost');
        
    }
}
